home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1142 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.1 KB

  1. Path: news.cis.nctu.edu.tw!usenet
  2. From: terryt@mcs.com (Terry Trippany)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: How to use CEdit.GetLine
  5. Date: 9 Jan 1996 16:45:51 GMT
  6. Organization: STR/Baxter Labs
  7. Message-ID: <4cu63v$qta@news.cis.nctu.edu.tw>
  8. References: <960108.175553.3102@banshee.uunet.ca>
  9. NNTP-Posting-Host: @159.198.73.111
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.7
  13.  
  14. In article <960108.175553.3102@banshee.uunet.ca>, ffisl@travel-net.com says...
  15. >
  16. >Hi!
  17. >
  18. >Could anyone post a short example on how to use the CEdit.GetLine
  19. >function to retrieve a line from an edit control in a dialog box ad
  20. >convert the retrieved string to a number?
  21. >
  22. >Thanks, Frank
  23. >
  24.  
  25.  
  26. The GetLine function only works for multiline edit controls.  It is very easy to use.
  27.  
  28. Suppose you already have a CEdit control object set up
  29.  
  30. CEdit editControl;
  31.  
  32. you can simply do the following to retrieve a value from line 0:
  33. CString strEditBuf;
  34.  
  35. editControl.GetLine(0, strEditBuf);
  36.  
  37. // convert using atoi 
  38. int i = atoi(strEditBuf)
  39.  
  40. // you have to check the return values and such
  41.  
  42. This should get you in the right direction.
  43.  
  44. Terry
  45.  
  46.